/*
2019.9.29
day32
*/
#include<stdlib.h>
#include<stdio.h>

struct ListNode {
    int val;
    struct ListNode *next;
};

bool hasCycle(struct ListNode *head) {
	if(head==NULL||head->next==NULL)
            return false;
        struct ListNode *fast=head->next->next;
        struct ListNode *slow=head->next;
        while(fast)
        {
            slow=slow->next;
            for(int i=0;i<2;i++)
            {
                if(fast->next==NULL)
                    return false;
                fast=fast->next;
                if(fast==slow)
                    return true;
            }
        }
        return false;
}
int main()
{
	return 0;
}
